package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the ROLE_ database table.
 * 
 */
@Entity
@Table(name="ROLE_")
@NamedQuery(name="Role.findAll", query="SELECT r FROM Role r")
public class Role implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ROLE__ROLEID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ROLE__ROLEID_GENERATOR")
	@Column(name="ROLE_ID")
	private long roleId;

	@Column(name="ROLE_EXPLAIN")
	private String roleExplain;

	@Column(name="ROLE_IFDELETE")
	private BigDecimal roleIfdelete;

	@Temporal(TemporalType.DATE)
	@Column(name="ROLE_INTODATE")
	private Date roleIntodate;

	@Column(name="ROLE_NAME")
	private String roleName;

	//bi-directional many-to-many association to Function
	@ManyToMany
	@JSONField(serialize=false)
	@JoinTable(
		name="RELATIONSHIP_24"
		, joinColumns={
			@JoinColumn(name="ROLE_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="FUNCTION_ID")
			}
		)
	private List<Function> functions;

	//bi-directional many-to-many association to User
	@ManyToMany(mappedBy="roles")
	@JSONField(serialize=false)
	private List<User> users;

	public Role() {
	}

	public long getRoleId() {
		return this.roleId;
	}

	public void setRoleId(long roleId) {
		this.roleId = roleId;
	}

	public String getRoleExplain() {
		return this.roleExplain;
	}

	public void setRoleExplain(String roleExplain) {
		this.roleExplain = roleExplain;
	}

	public BigDecimal getRoleIfdelete() {
		return this.roleIfdelete;
	}

	public void setRoleIfdelete(BigDecimal roleIfdelete) {
		this.roleIfdelete = roleIfdelete;
	}

	public Date getRoleIntodate() {
		return this.roleIntodate;
	}

	public void setRoleIntodate(Date roleIntodate) {
		this.roleIntodate = roleIntodate;
	}

	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public List<Function> getFunctions() {
		return this.functions;
	}

	public void setFunctions(List<Function> functions) {
		this.functions = functions;
	}

	public List<User> getUsers() {
		return this.users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

}